package com.medusa.aps.business.modules.basic.model.input;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.medusa.aps.business.model.constant.RegexPool;
import com.medusa.aps.business.common.web.valid.group.Update;
import com.medusa.aps.business.global.model.constant.RegexPools;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Range;

@Getter
@Setter
public class CustomerInformationDTO {

    /**
     * 主键
     */
    @Schema(description = "主键")
    @TableId(type = IdType.AUTO)
    @NotNull(message = "主键不能为空", groups = {Update.class})
    private Integer id;
    /**
     * 客户编码
     */
    @Schema(description = "客户编码")
    @NotBlank(message = "客户编码不能为空")
    @Size(max = 50, message = "客户编码长度不能超过50")
    @Pattern(regexp = RegexPool.ORDER_NO, message = "客户编码只支持数字、字母、符号")
    private String customerCode;

    /**
     * 客户公司名称
     */
    @Schema(description = "客户公司名称")
    @NotBlank(message = "客户公司名称不能为空")
    @Size(max = 50, message = "客户公司名称长度不能超过50")
    private String customerCompanyName;

    /**
     * 客户电话
     */
    @Schema(description = "客户电话")
    @NotBlank(message = "客户电话不能为空")
    @Pattern(regexp = RegexPools.MOBILE_TEL, message = "请输入正确的电话号码固话请用-分隔区号")
    @Size(max = 20, message = "客户电话长度不能超过11")
    private String customerPhone;


    /**
     * 客户姓名
     */
    @Schema(description = "客户姓名")
    @NotBlank(message = "客户姓名不能为空")
    @Size(max = 50, message = "客户姓名长度不能超过50")
    private String customerName;

    /**
     * 客户优先级
     */
    @Schema(description = "客户优先级")
    @NotNull(message = "客户优先级不能为空")
    @Range(min = 1, max = 5, message = "客户优先级取值范围为1-5")
    private Integer customerPriority;


}
